#ifndef __INIT_H__
#define __INIT_H__
#include <unistd.h>

/**
 * @brief: create a container with image, it will detach from the container
 automatically. (TODO)
 * @param: `image_path` - path of image file (support tar.gz files only)
 * @param: `command`    - the first command in the container (support PATH
 *environment variable, does not need to be physical path)
 * @param: `argv`       - arguments of command
 * @param: `pipe_fd_child` - used to communicate with outer func, it will
 *write the created child pid back.
 * @return: return the container id
 **/
int cntr_create(const char *image_path, const char *command, char *argv[],
                int pipe_fd_child, int netns_ip);

/**
 * @brief: attach to a container
 * @param: `container_id` - container id is a unique random number (may not be
 *that unique)
 * @param: `command`      - the attached command in the container (support PATH
 *environment variable, does not need to be physical path).
 *If it is NULL, attach will try to get the foreground of the last created
 *active process
 * @param: `argv`         - arguments of command. If `command` is NULL then this
 *parameter should be NULL.
 * @return: On success, zero is returned.
 **/
int cntr_attach(const int container_id, const char *command, char *argv[]);

/**
 * @brief: delete a container and its persistence files
 * @param: `container_id` - container id is a unique random number (may not be
 *that unique)
 **/
int cntr_delete(const int container_id);

#endif // !__INIT_H__
